package control;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.TextArea;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;

// 滚动窗体
public class ScrollPaneDemo extends Application {
	private Pane root = new Pane();
	private ScrollPane sp;
	private TextArea ta;
	
	public static void main(String[] args) {
		launch(args);
	}
	
	@Override
	public void start(Stage stage) {
		
		ta = new TextArea();
		ta.setPrefSize(150, 150);
		ta.setText("aaaaaaaaaaaaaaaaaaaaaaaa/na/na/na/na/na/na/na/na/na/na");
				
		sp = new ScrollPane();
		sp.setContent(ta);		// 添加内容
		root.getChildren().add(sp);
		
		Scene scene = new Scene(root, 300, 250);
		stage.setScene(scene);
		stage.show();
	}
}
